<template>
	<view class="">
		<!-- <u-tabs :list="lists" @click="click"></u-tabs> -->
		
		<view class="">
			<view class="xuanze" v-for="(item,index) in lists" :key="index" @click="dianji(item)">
				{{item.title}}
			</view>
			
		</view>
		
		
	</view>
</template>

<script>
	import {
		mapActions,
		mapGetters
	} from 'vuex';
	export default {
		
		onLoad(options){
			console.log(options,'查看type')
			this.getFenList()
			
		},
		
		data() {
			return {
				lists :[],
				fenlei:'',
				feenleiTitle:'',
			}
		},
		
		
		
		methods: {
			getFenList(){
				this.$req('GET',this.$api.fenLlist,{}).then(res =>{
					
					// this.lists = res.data.list.map(item => ({ name: item.title }));
					this.lists = res.data.list
					
					console.log(this.lists,'查看分类列表')
					
				})
			},
			dianji(item){
				console.log(item,'查看点击的item是什么')
				this.fenlei = item.id
				this.feenleiTitle = item.title
				uni.setStorageSync('fenlei',this.fenlei)
				uni.setStorageSync('feenleiTitle',this.feenleiTitle)
				uni.navigateBack()
			}
			
		},
		
	}
</script>

<style>
	page{
	      background: #f5f5f5;
	    }
	
	.xuanze{
		width: 90%;
		height: 100rpx;
		background-color: #fff;
		border-radius: 20rpx;
		margin: 30rpx;
		line-height: 100rpx;
		padding-left: 20rpx;
		font-size: 40rpx;
		font-weight: 900;
	}	
		
		
		
</style>